/************************************************************
 * Copyright (c) 2010 Georg Fritzsche
 *
 * This project is licensed under the "New BSD License": 
 * http://www.opensource.org/licenses/bsd-license.php
 ***********************************************************/

#ifndef TRIGGER_CONFIG_H
#define TRIGGER_CONFIG_H

#include <string>
#include <stdexcept>
#include "midi_listener.h"

struct config_error : std::runtime_error 
{
    config_error(const char* const  message) : std::runtime_error(message) {}
    config_error(const std::string& message) : std::runtime_error(message.c_str()) {}
};

class Config
{
public:
    Config(int argc, char** argv);

    const std::string& playlistPath() const { return m_playlistPath;      }
    unsigned               midiPort() const { return m_midiPort;          }
    bool                    exitNow() const { return m_exitNow;           }
    bool                listDevices() const { return m_listDevices;       }
    bool              streamSamples() const { return m_streamSamples;     }
    int           audioDeviceNumber() const { return m_audioDeviceNumber; }
    
    const MidiListener::ActionMap& midiActionMap() const { return m_midiActionMap; }

private:
    std::string m_playlistPath;
    unsigned m_midiPort;
    bool m_exitNow;
    bool m_listDevices;
    bool m_streamSamples;
    MidiListener::ActionMap m_midiActionMap;
    int m_audioDeviceNumber;
};

#endif
